import ddddocr
import requests

slide = ddddocr.DdddOcr(det=False, ocr=False)

with open('target.jpg', 'rb') as f:
    target_bytes = f.read()

with open('background.jpg', 'rb') as f:
    background_bytes = f.read()

res = slide.slide_match(target_bytes, background_bytes, simple_target=True)

print(res)
header = {
    'Content-Type':'application/x-www-form-urlencoded',
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/6.8.0(0x16080000) NetType/WIFI MiniProgramEnv/Mac MacWechat/WMPF XWEB/30817',
'authorization':'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJVc2VyTmFtZSI6IjE1ODI1NCIsIlB3ZCI6InhpT0tyRkRkUXIrUGRaR2wzdUxwZEdtQ254K0k3dzhyIiwiRGV2aWNlaWQiOiJ1WnZtNG91ZzlEYUxtc1BPY3VFM2N0SERVSHdMbVoxeiIsImlhdCI6IjE3MDI4OTUzMzgiLCJleHAiOiIxNzAyOTgxNzM4IiwianRpIjoiMGQxMTZhMzQtYmUzNi00MmIwLThiNzEtNjg3ZjQ5MGVmOWM2In0.W-imeVKXoc4DHOxfO4KId7jjnZ4eK40hlMUTX9ivsyc'
}

data={
'sendstr':'Wv3xf2aMd3wk3PXy2nvEK0U/TaTMYW4n9112Y/pYMPVz/RVLQKWVjY7Y1L3VPjWq+yanl/dYGukgu5nTSju2EOWfnoIBr6E82gAFq5bxZLwzMUjnhnSsivDijK9fiLjLBlG5hK4A/o08GQ4lhJ90bE+SLQQR2U+xy1AA3qaUlhEJpy8ZHRTmhPrr9CHmRMFxD5McoTSbchws7G1p8Fm1NLfrYKAFoQ6QTR7bPx1j74w1RazbpxsI4AuPYZmRH6QM0Gsk7n0oq14OH2DGs10OnGk6IlR+/gMW2A/4oJswY1SJFwC1rOX7V+K3/yhsO+JbWl3A2qCO94/Ay5iYbFG7rg=='
}
result = requests.post('https://wxapi.mgsco.cn:8085/wxapi/Task/GetQdlist', headers=header,data=data).json()
if(result['status']=='1'):
    for a in result['data']:
        print(a)


